/**
 * @Author DengJia
 * @Date 2021/8/11 22:07
 * @Description
 */

public class InitDemo {
    private String name;

    private String str1 = "定义时就初始化了的String域";
    private String str2;

    public InitDemo() {
        this.str2 = "构造时初始化的String域";
    }


    public static void main(String[] args) {
        InitDemo initDemo = new InitDemo();
        System.out.println("initDemo.name = " + initDemo.name);
        System.out.println("initDemo.str1 = " + initDemo.str1);
        System.out.println("initDemo.str2 = " + initDemo.str2);
    }
}
